from re import compile
import re

str_1 = "a,b,,,c,,d"

obj_comp = compile('[,]+')  # 返回一个compile对象, 这个对象携带了正则表达式'[,]+'
new_str_1 = obj_comp.split(str_1)  # 可以重复使用正则表达式
print(new_str_1)

str_2 = "python313Mc, pyth1on34javac, pythonM3.7c, pytho2n^c, python2qwcc"
obj_comp = compile('^python.*c$')
new_str_2 = re.findall(obj_comp, str_2)
new2_srt_2 = obj_comp.findall(str_2)

print(new_str_2)
print(new2_srt_2)

s = "1a23afaggfhew254hrejj4469"
s2 = re.search("\d{3}.*[^\d]", s)
print(s2.group())